import random
import time

# 定义双色球的规则
red_balls = list(range(1, 34))
blue_balls = list(range(1, 17))

# 定义生成双色球号码的函数
def generate_numbers():
    # 洗牌算法打乱红球和蓝球集合
    random.shuffle(red_balls)
    random.shuffle(blue_balls)

    # 随机等待时间，单位为秒
    wait_time = random.randint(5, 17)

    # 生成红球号码
    red_numbers = sorted(random.sample(red_balls, 7))
    print('红球号码：', red_numbers)
    time.sleep(wait_time)

    # 生成蓝球号码
    blue_number = random.choice(blue_balls)
    print('蓝球号码：', blue_number)
    print('\n')
    time.sleep(wait_time)

# 生成2组双色球
for i in range(2):
    print('第', i+1, '组双色球号码：')
    generate_numbers()
